/*******************************************************************************
 * Copyright (c) 2007 University of Oslo.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     University of Oslo - initial API and implementation
 *******************************************************************************/

package com.cea.papyrus.diagram.sequence.sedi.model.command;

import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.NamedElement;

/**
 * Specifies the exact position of a MessageEnd on a lifeline. 
 * 
 * @author frankd@ifi.uio.no
 * 
 * @see MessageEndPosition
 */
public class LifelineMessageEndPosition extends MessageEndPosition {

	/** 
	 * A LifelinePosition constant that designates the topmost
	 * position on a lifeline.
	 * 
	 * @see #setLifelinePosition(NamedElement)
	 */
	public static final NamedElement TOP = null;
	
	/**
	 * The Lifeline that is covered by the MessageEnd.
	 */
	private Lifeline lifeline;
	
	/**
	 * The MessageEnd is placed immediately <i>after</i> the MessageEnd 
	 * identified by this attribute. It may be null, in which case the 
	 * message is added in front.
	 */
	private NamedElement lifelinePosition;
	
	public LifelineMessageEndPosition() {
	}
	public LifelineMessageEndPosition(
			final NamedElement owner, final Lifeline lifeline, 
			final NamedElement lifelinePosition) {
		super(owner);
		this.lifeline = lifeline;
		this.lifelinePosition = lifelinePosition;
	}

	public Lifeline getLifeline() {
		return lifeline;
	}
	public void setLifeline(final Lifeline lifeline) {
		this.lifeline = lifeline;
	}

	public NamedElement getLifelinePosition() {
		return lifelinePosition;
	}
	public void setLifelinePosition(final NamedElement lifelinePosition) {
		this.lifelinePosition = lifelinePosition;
	}
}
